import React,{useRef} from 'react'

function UseRef(){
	const Input=useRef();
	const getFocus=()=>{
		console.log(Input.current.value)
	}
	return (
		<div className="container">
			<div className="wrapper">
				<input ref={Input} className="mb-3 form-control" type="text"/>
				<button onClick={getFocus} className='btn btn-primary'>获取焦点</button>
			</div>
		</div>
	)
}

export default UseRef